package com.ancun;

import ancun.seal.servlet.SealClient;
import ancun.seal.util.FileUtil;
import ancun.seal.util.StringUtil;

import org.junit.Test;

import java.io.File;
import java.util.UUID;

/**
 * PDF自动化批量签章
 *
 * @author zhouchunlin
 *
 */
public class batchSealAutoPdfTest extends ServletBaseTest{

    @Test
    public void batchSealAutoPdfTest() throws Exception {
        /** HTTP方式 */
        String url = super.url + SealClient.SLASH + SealClient.PDF_SEAL_SERVLET;
        SealClient sealClient = new SealClient(url);

//        String batchSealStrategyXMLs = "<List><?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n" +
//                "<Request>\n" +
//                "<Head/>\n" +
//                "<Body>\n" +
//                "<SerialVersionUID/>\n" +
//                "<Type>2</Type>\n" +
//                "<SealCode>szca_2_1560243828554535</SealCode>\n" +
//                "<SealPassword>ac755375</SealPassword>\n" +
//                "<SealResson>爱签系统防伪造行篡改数字校验</SealResson>\n" +
//                "<Page>1</Page>\n" +
//                "<LX>0.47</LX>\n" +
//                "<LY>0.56</LY>\n" +
//                "</Body>\n" +
//                "</Request>,<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n" +
//                "<Request>\n" +
//                "<Head/>\n" +
//                "<Body>\n" +
//                "<SerialVersionUID/>\n" +
//                "<Type>2</Type>\n" +
//                "<SealCode>szca_1_1559795219970746</SealCode>\n" +
//                "<SealPassword>ac104079</SealPassword>\n" +
//                "<SealResson>安存电子合同签约专用</SealResson>\n" +
//                "<Page>1</Page>\n" +
//                "<LX>0.49</LX>\n" +
//                "<LY>0.43999999999999995</LY>\n" +
//                "</Body>\n" +
//                "</Request>,<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n" +
//                "<Request>\n" +
//                "<Head/>\n" +
//                "<Body>\n" +
//                "<SerialVersionUID/>\n" +
//                "<Type>2</Type>\n" +
//                "<SealCode>szca_1_1559795219970746</SealCode>\n" +
//                "<SealPassword>ac104079</SealPassword>\n" +
//                "<SealResson>安存电子合同签约专用</SealResson>\n" +
//                "<Page>1</Page>\n" +
//                "<LX>0.09</LX>\n" +
//                "<LY>0.31000000000000005</LY>\n" +
//                "</Body>\n" +
//                "</Request>,<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n" +
//                "<Request>\n" +
//                "<Head/>\n" +
//                "<Body>\n" +
//                "<SerialVersionUID/>\n" +
//                "<Type>2</Type>\n" +
//                "<SealCode>szca_2_1560243828927776</SealCode>\n" +
//                "<SealPassword>ac032000</SealPassword>\n" +
//                "<SealResson>爱签系统防伪造行篡改数字校验</SealResson>\n" +
//                "<Page>1</Page>\n" +
//                "<LX>0.42</LX>\n" +
//                "<LY>0.32999999999999996</LY>\n" +
//                "</Body>\n" +
//                "</Request>,<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n" +
//                "<Request>\n" +
//                "<Head/>\n" +
//                "<Body>\n" +
//                "<SerialVersionUID/>\n" +
//                "<Type>2</Type>\n" +
//                "<SealCode>szca_2_156024382920454</SealCode>\n" +
//                "<SealPassword>ac391765</SealPassword>\n" +
//                "<SealResson>爱签系统防伪造行篡改数字校验</SealResson>\n" +
//                "<Page>1</Page>\n" +
//                "<LX>0.51</LX>\n" +
//                "<LY>0.6699999999999999</LY>\n" +
//                "</Body>\n" +
//                "</Request>,<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n" +
//                "<Request>\n" +
//                "<Head/>\n" +
//                "<Body>\n" +
//                "<SerialVersionUID/>\n" +
//                "<Type>2</Type>\n" +
//                "<SealCode>szca_2_1560243829581849</SealCode>\n" +
//                "<SealPassword>ac282581</SealPassword>\n" +
//                "<SealResson>爱签系统防伪造行篡改数字校验</SealResson>\n" +
//                "<Page>1</Page>\n" +
//                "<LX>0.12</LX>\n" +
//                "<LY>0.45999999999999996</LY>\n" +
//                "</Body>\n" +
//                "</Request>,<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n" +
//                "<Request>\n" +
//                "<Head/>\n" +
//                "<Body>\n" +
//                "<SerialVersionUID/>\n" +
//                "<Type>2</Type>\n" +
//                "<SealCode>szca_1_1559795219970746</SealCode>\n" +
//                "<SealPassword>ac104079</SealPassword>\n" +
//                "<SealResson>安存电子合同签约专用</SealResson>\n" +
//                "<Page>2</Page>\n" +
//                "<LX>0.28</LX>\n" +
//                "<LY>0.74</LY>\n" +
//                "</Body>\n" +
//                "</Request>,<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n" +
//                "<Request>\n" +
//                "<Head/>\n" +
//                "<Body>\n" +
//                "<SerialVersionUID/>\n" +
//                "<Type>2</Type>\n" +
//                "<SealCode>szca_2_1560243829895532</SealCode>\n" +
//                "<SealPassword>ac130921</SealPassword>\n" +
//                "<SealResson>爱签系统防伪造行篡改数字校验</SealResson>\n" +
//                "<Page>2</Page>\n" +
//                "<LX>0.41</LX>\n" +
//                "<LY>0.6799999999999999</LY>\n" +
//                "</Body>\n" +
//                "</Request>,<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n" +
//                "<Request>\n" +
//                "<Head/>\n" +
//                "<Body>\n" +
//                "<SerialVersionUID/>\n" +
//                "<Type>2</Type>\n" +
//                "<SealCode>szca_1_1559795219970746</SealCode>\n" +
//                "<SealPassword>ac104079</SealPassword>\n" +
//                "<SealResson>安存电子合同签约专用</SealResson>\n" +
//                "<Page>2</Page>\n" +
//                "<LX>0.21</LX>\n" +
//                "<LY>0.5800000000000001</LY>\n" +
//                "</Body>\n" +
//                "</Request>,<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n" +
//                "<Request>\n" +
//                "<Head/>\n" +
//                "<Body>\n" +
//                "<SerialVersionUID/>\n" +
//                "<Type>2</Type>\n" +
//                "<SealCode>szca_2_156024383011552</SealCode>\n" +
//                "<SealPassword>ac850195</SealPassword>\n" +
//                "<SealResson>爱签系统防伪造行篡改数字校验</SealResson>\n" +
//                "<Page>2</Page>\n" +
//                "<LX>0.48</LX>\n" +
//                "<LY>0.5</LY>\n" +
//                "</Body>\n" +
//                "</Request>,<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n" +
//                "<Request>\n" +
//                "<Head/>\n" +
//                "<Body>\n" +
//                "<SerialVersionUID/>\n" +
//                "<Type>2</Type>\n" +
//                "<SealCode>szca_2_1560243830356799</SealCode>\n" +
//                "<SealPassword>ac609281</SealPassword>\n" +
//                "<SealResson>爱签系统防伪造行篡改数字校验</SealResson>\n" +
//                "<Page>2</Page>\n" +
//                "<LX>0.24</LX>\n" +
//                "<LY>0.38</LY>\n" +
//                "</Body>\n" +
//                "</Request>,<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n" +
//                "<Request>\n" +
//                "<Head/>\n" +
//                "<Body>\n" +
//                "<SerialVersionUID/>\n" +
//                "<Type>2</Type>\n" +
//                "<SealCode>szca_1_1559795219970746</SealCode>\n" +
//                "<SealPassword>ac104079</SealPassword>\n" +
//                "<SealResson>安存电子合同签约专用</SealResson>\n" +
//                "<Page>2</Page>\n" +
//                "<LX>0.58</LX>\n" +
//                "<LY>0.30000000000000004</LY>\n" +
//                "</Body>\n" +
//                "</Request>,<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n" +
//                "<Request>\n" +
//                "<Head/>\n" +
//                "<Body>\n" +
//                "<SerialVersionUID/>\n" +
//                "<Type>2</Type>\n" +
//                "<SealCode>szca_1_1559795219970746</SealCode>\n" +
//                "<SealPassword>ac104079</SealPassword>\n" +
//                "<SealResson>安存电子合同签约专用</SealResson>\n" +
//                "<Page>2</Page>\n" +
//                "<LX>0.28</LX>\n" +
//                "<LY>0.24</LY>\n" +
//                "</Body>\n" +
//                "</Request>,<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n" +
//                "<Request>\n" +
//                "<Head/>\n" +
//                "<Body>\n" +
//                "<SerialVersionUID/>\n" +
//                "<Type>2</Type>\n" +
//                "<SealCode>szca_2_1560243830701983</SealCode>\n" +
//                "<SealPassword>ac222047</SealPassword>\n" +
//                "<SealResson>爱签系统防伪造行篡改数字校验</SealResson>\n" +
//                "<Page>2</Page>\n" +
//                "<LX>0.34</LX>\n" +
//                "<LY>0.18999999999999995</LY>\n" +
//                "</Body>\n" +
//                "</Request>,<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n" +
//                "<Request>\n" +
//                "<Head/>\n" +
//                "<Body>\n" +
//                "<SerialVersionUID/>\n" +
//                "<Type>2</Type>\n" +
//                "<SealCode>szca_1_1559795219970746</SealCode>\n" +
//                "<SealPassword>ac104079</SealPassword>\n" +
//                "<SealResson>安存电子合同签约专用</SealResson>\n" +
//                "<Page>3</Page>\n" +
//                "<LX>0.18</LX>\n" +
//                "<LY>0.8</LY>\n" +
//                "</Body>\n" +
//                "</Request>,<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n" +
//                "<Request>\n" +
//                "<Head/>\n" +
//                "<Body>\n" +
//                "<SerialVersionUID/>\n" +
//                "<Type>2</Type>\n" +
//                "<SealCode>szca_2_1560243830975339</SealCode>\n" +
//                "<SealPassword>ac708379</SealPassword>\n" +
//                "<SealResson>爱签系统防伪造行篡改数字校验</SealResson>\n" +
//                "<Page>3</Page>\n" +
//                "<LX>0.33</LX>\n" +
//                "<LY>0.77</LY>\n" +
//                "</Body>\n" +
//                "</Request>,<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n" +
//                "<Request>\n" +
//                "<Head/>\n" +
//                "<Body>\n" +
//                "<SerialVersionUID/>\n" +
//                "<Type>2</Type>\n" +
//                "<SealCode>szca_2_1560243831317110</SealCode>\n" +
//                "<SealPassword>ac601828</SealPassword>\n" +
//                "<SealResson>爱签系统防伪造行篡改数字校验</SealResson>\n" +
//                "<Page>3</Page>\n" +
//                "<LX>0.28</LX>\n" +
//                "<LY>0.7</LY>\n" +
//                "</Body>\n" +
//                "</Request>,<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n" +
//                "<Request>\n" +
//                "<Head/>\n" +
//                "<Body>\n" +
//                "<SerialVersionUID/>\n" +
//                "<Type>2</Type>\n" +
//                "<SealCode>szca_1_1559795219970746</SealCode>\n" +
//                "<SealPassword>ac104079</SealPassword>\n" +
//                "<SealResson>安存电子合同签约专用</SealResson>\n" +
//                "<Page>3</Page>\n" +
//                "<LX>0.54</LX>\n" +
//                "<LY>0.8</LY>\n" +
//                "</Body>\n" +
//                "</Request>,<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n" +
//                "<Request>\n" +
//                "<Head/>\n" +
//                "<Body>\n" +
//                "<SerialVersionUID/>\n" +
//                "<Type>2</Type>\n" +
//                "<SealCode>szca_2_1560243831641905</SealCode>\n" +
//                "<SealPassword>ac546537</SealPassword>\n" +
//                "<SealResson>爱签系统防伪造行篡改数字校验</SealResson>\n" +
//                "<Page>3</Page>\n" +
//                "<LX>0.48</LX>\n" +
//                "<LY>0.6699999999999999</LY>\n" +
//                "</Body>\n" +
//                "</Request>,<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n" +
//                "<Request>\n" +
//                "<Head/>\n" +
//                "<Body>\n" +
//                "<SerialVersionUID/>\n" +
//                "<Type>2</Type>\n" +
//                "<SealCode>szca_1_1559795219970746</SealCode>\n" +
//                "<SealPassword>ac104079</SealPassword>\n" +
//                "<SealResson>安存电子合同签约专用</SealResson>\n" +
//                "<Page>3</Page>\n" +
//                "<LX>0.15</LX>\n" +
//                "<LY>0.5700000000000001</LY>\n" +
//                "</Body>\n" +
//                "</Request>,<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n" +
//                "<Request>\n" +
//                "<Head/>\n" +
//                "<Body>\n" +
//                "<SerialVersionUID/>\n" +
//                "<Type>2</Type>\n" +
//                "<SealCode>szca_2_1560243831959985</SealCode>\n" +
//                "<SealPassword>ac189157</SealPassword>\n" +
//                "<SealResson>爱签系统防伪造行篡改数字校验</SealResson>\n" +
//                "<Page>3</Page>\n" +
//                "<LX>0.37</LX>\n" +
//                "<LY>0.5</LY>\n" +
//                "</Body>\n" +
//                "</Request>,<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n" +
//                "<Request>\n" +
//                "<Head/>\n" +
//                "<Body>\n" +
//                "<SerialVersionUID/>\n" +
//                "<Type>2</Type>\n" +
//                "<SealCode>szca_2_1560243832290286</SealCode>\n" +
//                "<SealPassword>ac933316</SealPassword>\n" +
//                "<SealResson>爱签系统防伪造行篡改数字校验</SealResson>\n" +
//                "<Page>3</Page>\n" +
//                "<LX>0.51</LX>\n" +
//                "<LY>0.51</LY>\n" +
//                "</Body>\n" +
//                "</Request>,<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n" +
//                "<Request>\n" +
//                "<Head/>\n" +
//                "<Body>\n" +
//                "<SerialVersionUID/>\n" +
//                "<Type>2</Type>\n" +
//                "<SealCode>szca_1_1559795219970746</SealCode>\n" +
//                "<SealPassword>ac104079</SealPassword>\n" +
//                "<SealResson>安存电子合同签约专用</SealResson>\n" +
//                "<Page>4</Page>\n" +
//                "<LX>0.32</LX>\n" +
//                "<LY>0.78</LY>\n" +
//                "</Body>\n" +
//                "</Request>,<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n" +
//                "<Request>\n" +
//                "<Head/>\n" +
//                "<Body>\n" +
//                "<SerialVersionUID/>\n" +
//                "<Type>2</Type>\n" +
//                "<SealCode>szca_2_1560243832596879</SealCode>\n" +
//                "<SealPassword>ac078912</SealPassword>\n" +
//                "<SealResson>爱签系统防伪造行篡改数字校验</SealResson>\n" +
//                "<Page>4</Page>\n" +
//                "<LX>0.67</LX>\n" +
//                "<LY>0.79</LY>\n" +
//                "</Body>\n" +
//                "</Request>,<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n" +
//                "<Request>\n" +
//                "<Head/>\n" +
//                "<Body>\n" +
//                "<SerialVersionUID/>\n" +
//                "<Type>2</Type>\n" +
//                "<SealCode>szca_2_1560243832887749</SealCode>\n" +
//                "<SealPassword>ac424415</SealPassword>\n" +
//                "<SealResson>爱签系统防伪造行篡改数字校验</SealResson>\n" +
//                "<Page>4</Page>\n" +
//                "<LX>0.21</LX>\n" +
//                "<LY>0.6699999999999999</LY>\n" +
//                "</Body>\n" +
//                "</Request>,<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n" +
//                "<Request>\n" +
//                "<Head/>\n" +
//                "<Body>\n" +
//                "<SerialVersionUID/>\n" +
//                "<Type>2</Type>\n" +
//                "<SealCode>szca_1_1559795219970746</SealCode>\n" +
//                "<SealPassword>ac104079</SealPassword>\n" +
//                "<SealResson>安存电子合同签约专用</SealResson>\n" +
//                "<Page>4</Page>\n" +
//                "<LX>0.44</LX>\n" +
//                "<LY>0.63</LY>\n" +
//                "</Body>\n" +
//                "</Request>,<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n" +
//                "<Request>\n" +
//                "<Head/>\n" +
//                "<Body>\n" +
//                "<SerialVersionUID/>\n" +
//                "<Type>2</Type>\n" +
//                "<SealCode>szca_2_1560243833150920</SealCode>\n" +
//                "<SealPassword>ac368231</SealPassword>\n" +
//                "<SealResson>爱签系统防伪造行篡改数字校验</SealResson>\n" +
//                "<Page>4</Page>\n" +
//                "<LX>0.25</LX>\n" +
//                "<LY>0.54</LY>\n" +
//                "</Body>\n" +
//                "</Request>,<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n" +
//                "<Request>\n" +
//                "<Head/>\n" +
//                "<Body>\n" +
//                "<SerialVersionUID/>\n" +
//                "<Type>2</Type>\n" +
//                "<SealCode>szca_1_1559795219970746</SealCode>\n" +
//                "<SealPassword>ac104079</SealPassword>\n" +
//                "<SealResson>安存电子合同签约专用</SealResson>\n" +
//                "<Page>4</Page>\n" +
//                "<LX>0.47</LX>\n" +
//                "<LY>0.5</LY>\n" +
//                "</Body>\n" +
//                "</Request>,<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n" +
//                "<Request>\n" +
//                "<Head/>\n" +
//                "<Body>\n" +
//                "<SerialVersionUID/>\n" +
//                "<Type>2</Type>\n" +
//                "<SealCode>szca_1_1559795219970746</SealCode>\n" +
//                "<SealPassword>ac104079</SealPassword>\n" +
//                "<SealResson>安存电子合同签约专用</SealResson>\n" +
//                "<Page>4</Page>\n" +
//                "<LX>0.16</LX>\n" +
//                "<LY>0.43999999999999995</LY>\n" +
//                "</Body>\n" +
//                "</Request>,<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n" +
//                "<Request>\n" +
//                "<Head/>\n" +
//                "<Body>\n" +
//                "<SerialVersionUID/>\n" +
//                "<Type>2</Type>\n" +
//                "<SealCode>szca_2_1560243833431204</SealCode>\n" +
//                "<SealPassword>ac306369</SealPassword>\n" +
//                "<SealResson>爱签系统防伪造行篡改数字校验</SealResson>\n" +
//                "<Page>4</Page>\n" +
//                "<LX>0.53</LX>\n" +
//                "<LY>0.41000000000000003</LY>\n" +
//                "</Body>\n" +
//                "</Request>,<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n" +
//                "<Request>\n" +
//                "<Head/>\n" +
//                "<Body>\n" +
//                "<SerialVersionUID/>\n" +
//                "<Type>2</Type>\n" +
//                "<SealCode>szca_1_1559795219970746</SealCode>\n" +
//                "<SealPassword>ac104079</SealPassword>\n" +
//                "<SealResson>安存电子合同签约专用</SealResson>\n" +
//                "<Page>5</Page>\n" +
//                "<LX>0.26</LX>\n" +
//                "<LY>0.72</LY>\n" +
//                "</Body>\n" +
//                "</Request>,<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n" +
//                "<Request>\n" +
//                "<Head/>\n" +
//                "<Body>\n" +
//                "<SerialVersionUID/>\n" +
//                "<Type>2</Type>\n" +
//                "<SealCode>szca_2_1560243833759405</SealCode>\n" +
//                "<SealPassword>ac276790</SealPassword>\n" +
//                "<SealResson>爱签系统防伪造行篡改数字校验</SealResson>\n" +
//                "<Page>5</Page>\n" +
//                "<LX>0.59</LX>\n" +
//                "<LY>0.8</LY>\n" +
//                "</Body>\n" +
//                "</Request>,<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n" +
//                "<Request>\n" +
//                "<Head/>\n" +
//                "<Body>\n" +
//                "<SerialVersionUID/>\n" +
//                "<Type>2</Type>\n" +
//                "<SealCode>szca_1_1559795219970746</SealCode>\n" +
//                "<SealPassword>ac104079</SealPassword>\n" +
//                "<SealResson>安存电子合同签约专用</SealResson>\n" +
//                "<Page>5</Page>\n" +
//                "<LX>0.19</LX>\n" +
//                "<LY>0.81</LY>\n" +
//                "</Body>\n" +
//                "</Request>,<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n" +
//                "<Request>\n" +
//                "<Head/>\n" +
//                "<Body>\n" +
//                "<SerialVersionUID/>\n" +
//                "<Type>2</Type>\n" +
//                "<SealCode>szca_2_1560243834107834</SealCode>\n" +
//                "<SealPassword>ac114435</SealPassword>\n" +
//                "<SealResson>爱签系统防伪造行篡改数字校验</SealResson>\n" +
//                "<Page>5</Page>\n" +
//                "<LX>0.3</LX>\n" +
//                "<LY>0.63</LY>\n" +
//                "</Body>\n" +
//                "</Request>,<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n" +
//                "<Request>\n" +
//                "<Head/>\n" +
//                "<Body>\n" +
//                "<SerialVersionUID/>\n" +
//                "<Type>2</Type>\n" +
//                "<SealCode>szca_1_1559795219970746</SealCode>\n" +
//                "<SealPassword>ac104079</SealPassword>\n" +
//                "<SealResson>安存电子合同签约专用</SealResson>\n" +
//                "<Page>5</Page>\n" +
//                "<LX>0.51</LX>\n" +
//                "<LY>0.5800000000000001</LY>\n" +
//                "</Body>\n" +
//                "</Request>,<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n" +
//                "<Request>\n" +
//                "<Head/>\n" +
//                "<Body>\n" +
//                "<SerialVersionUID/>\n" +
//                "<Type>2</Type>\n" +
//                "<SealCode>szca_1_1559795219970746</SealCode>\n" +
//                "<SealPassword>ac104079</SealPassword>\n" +
//                "<SealResson>安存电子合同签约专用</SealResson>\n" +
//                "<Page>5</Page>\n" +
//                "<LX>0.6</LX>\n" +
//                "<LY>0.69</LY>\n" +
//                "</Body>\n" +
//                "</Request>,<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n" +
//                "<Request>\n" +
//                "<Head/>\n" +
//                "<Body>\n" +
//                "<SerialVersionUID/>\n" +
//                "<Type>2</Type>\n" +
//                "<SealCode>szca_2_1560243834382290</SealCode>\n" +
//                "<SealPassword>ac061498</SealPassword>\n" +
//                "<SealResson>爱签系统防伪造行篡改数字校验</SealResson>\n" +
//                "<Page>5</Page>\n" +
//                "<LX>0.26</LX>\n" +
//                "<LY>0.47</LY>\n" +
//                "</Body>\n" +
//                "</Request>,<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n" +
//                "<Request>\n" +
//                "<Head/>\n" +
//                "<Body>\n" +
//                "<SerialVersionUID/>\n" +
//                "<Type>2</Type>\n" +
//                "<SealCode>szca_2_1560243834808288</SealCode>\n" +
//                "<SealPassword>ac068846</SealPassword>\n" +
//                "<SealResson>爱签系统防伪造行篡改数字校验</SealResson>\n" +
//                "<Page>5</Page>\n" +
//                "<LX>0.54</LX>\n" +
//                "<LY>0.43999999999999995</LY>\n" +
//                "</Body>\n" +
//                "</Request></List>";

        StringBuilder batchSealStrategyXMLs = new StringBuilder();
        batchSealStrategyXMLs.append("<List>");
        int num = 10;
        for (int i = 0; i < num; i++) {
            String type;
            String pdfURL;
            String sealCode;
            String sealPassword;
            String sealPerson;
            String sealLocation;
            String sealResson;
            String businessCode;
            String businessCodeStyle;
            String blankFieldName;
            String page;
            String lX;
            String lY;
            String keyword;
            String locationStyle;
            String offsetX;
            String offsetY;

            /** 策略一 */
            String sealStrategyXML1 = "";

//            if (0 == i) {
                type = "2";//2：坐标 3：关键字
                pdfURL = "";

                sealCode = "cfca_3_1543453841318";//"cfca_1_1543457804359901";//"szca_1_1543410538325930";"123456_hancm_test1";"cfca_2_1543457804359901"
                sealPassword = "123456";
//                keyword = "配送合作协议";
                keyword = "投资合作协议";
                sealResson = "安存电子合同签约专用";

                page = "1";
                sealPerson = "admin";
                sealLocation = "beijingBatchSealAutoPdf";

                double wScale = 0.5;
                double hScale = 0.5;
                lX = String.valueOf(wScale);
                lY = String.valueOf(hScale);

//                double w = 595.276 * wScale;
//                double h = 841.89 * hScale;
//                lX = String.valueOf(w);
//                lY = String.valueOf(h);
                locationStyle = "";
                offsetX = "0";
                offsetY = "0";

                businessCode = "";
                blankFieldName = "Signature3";
                businessCodeStyle = "font-size:5;x-ratio:0.15;y-ratio:0.5;color:FF00AB;";
                sealStrategyXML1 = "<Request>" + "<Type>" + type + "</Type>" + "<PdfURL>" + pdfURL + "</PdfURL>" + "<SealCode>" + sealCode
                        + "</SealCode><SealPassword>" + sealPassword + "</SealPassword><Page>" + page + "</Page><SealPerson>" + sealPerson
                        + "</SealPerson><SealLocation>" + sealLocation + "</SealLocation>" + "<SealResson>" + sealResson + "</SealResson>" + "<BusinessCode>"
                        + businessCode + "</BusinessCode><BusinessCodeStyle>" + businessCodeStyle + "</BusinessCodeStyle>" + "<BlankFieldName>" + blankFieldName
                        + "</BlankFieldName>" + "<LX>" + lX + "</LX><LY>" + lY + "</LY><Keyword>" + keyword + "</Keyword>" + "<LocationStyle>" + locationStyle
                        + "</LocationStyle><OffsetX>" + offsetX + "</OffsetX><OffsetY>" + offsetY + "</OffsetY>" + "</Request>";

//            } else if (1 == i) {
//                type = "3";//2：坐标 3：关键字
//                pdfURL = "";
//
//                sealCode = "123456_hancm_test1";//"cfca_1_1543457804359900";//"szca_1_1543410538325930";"123456_hancm_test1"
//                sealPassword = "123456";
//                keyword = "电子签章投资章专用";//"配送合作协议";//"杭州市"; //"保险人签";//Integer.toString( i % 16);
//                sealResson = "爱签系统防伪造行篡改数字校验";
//
//                page = "4";
//                sealPerson = "admin";
//                sealLocation = "beijingBatchSealAutoPdf";
//                lX = "500";
//                lY = "250";
//                locationStyle = "";
//                offsetX = "0";
//                offsetY = "0";
//
//                businessCode = "";
//                blankFieldName = "Signature3";
//                businessCodeStyle = "font-size:5;x-ratio:0.15;y-ratio:0.5;color:FF00AB;";
//                sealStrategyXML1 = "<Request>" + "<Type>" + type + "</Type>" + "<PdfURL>" + pdfURL + "</PdfURL>" + "<SealCode>" + sealCode
//                        + "</SealCode><SealPassword>" + sealPassword + "</SealPassword><Page>" + page + "</Page><SealPerson>" + sealPerson
//                        + "</SealPerson><SealLocation>" + sealLocation + "</SealLocation>" + "<SealResson>" + sealResson + "</SealResson>" + "<BusinessCode>"
//                        + businessCode + "</BusinessCode><BusinessCodeStyle>" + businessCodeStyle + "</BusinessCodeStyle>" + "<BlankFieldName>" + blankFieldName
//                        + "</BlankFieldName>" + "<LX>" + lX + "</LX><LY>" + lY + "</LY><Keyword>" + keyword + "</Keyword>" + "<LocationStyle>" + locationStyle
//                        + "</LocationStyle><OffsetX>" + offsetX + "</OffsetX><OffsetY>" + offsetY + "</OffsetY>" + "</Request>";
//            } else if (2 == i) {
//                type = "3";//2：坐标 3：关键字
//                pdfURL = "";
//
//                sealCode = "szca_1_1543410538325930";//"cfca_1_1543457804359900";//"szca_1_1543410538325930";"123456_hancm_test1"
//                sealPassword = "123456";
//                keyword = "钱座平台章";//Integer.toString( i % 16);
//                sealResson = "爱签系统防伪造行篡改数字校验";
//
//                page = "4";
//                sealPerson = "admin";
//                sealLocation = "beijingBatchSealAutoPdf";
//                lX = "500";
//                lY = "250";
//                locationStyle = "C";
//                offsetX = "0";
//                offsetY = "0";
//
//                businessCode = "";
//                blankFieldName = "Signature3";
//                businessCodeStyle = "font-size:5;x-ratio:0.15;y-ratio:0.5;color:FF00AB;";
//                sealStrategyXML1 = "<Request>" + "<Type>" + type + "</Type>" + "<PdfURL>" + pdfURL + "</PdfURL>" + "<SealCode>" + sealCode
//                        + "</SealCode><SealPassword>" + sealPassword + "</SealPassword><Page>" + page + "</Page><SealPerson>" + sealPerson
//                        + "</SealPerson><SealLocation>" + sealLocation + "</SealLocation>" + "<SealResson>" + sealResson + "</SealResson>" + "<BusinessCode>"
//                        + businessCode + "</BusinessCode><BusinessCodeStyle>" + businessCodeStyle + "</BusinessCodeStyle>" + "<BlankFieldName>" + blankFieldName
//                        + "</BlankFieldName>" + "<LX>" + lX + "</LX><LY>" + lY + "</LY><Keyword>" + keyword + "</Keyword>" + "<LocationStyle>" + locationStyle
//                        + "</LocationStyle><OffsetX>" + offsetX + "</OffsetX><OffsetY>" + offsetY + "</OffsetY>" + "</Request>";
//            }

            if (i == num - 1) {
                batchSealStrategyXMLs.append(sealStrategyXML1).append("</List>");
            } else {
                batchSealStrategyXMLs.append(sealStrategyXML1).append(",");
            }
        }

//        String path = super.baseSources + "合伙人-diffword50_adobe-mupdf-验章字节范围错误_已修复.pdf";
        String path = super.baseSources + "4.pdf";
//        String path = super.baseSources + "pdf-cc-signed-pdf1.3-eof-itext验签失败-原文.pdf";
        byte[] pdf = FileUtil.getBytesFromFile(new File(path));

//        String pdfURL = "/ac/store/test.pdf&/ac/store/44.pdf";
//        byte[] pdf = pdfURL.getBytes();

//        byte[] pdf = ("/home/hancm/tdbank-sealserver/配送合作协议-podofo批量错误.pdf&/home/hancm/" + UUID.randomUUID() + ".pdf").getBytes();
//        byte[] pdf = ("/home/hancm/tdbank-sealserver/4.pdf&/home/hancm/" + UUID.randomUUID() + ".pdf").getBytes();

        System.out.println(batchSealStrategyXMLs + "\nPdf len: " + pdf.length);

        long time1 = System.currentTimeMillis();
        byte[] sealedPdf = sealClient.batchSealAutoPdf(pdf, batchSealStrategyXMLs.toString());
        long time2 = System.currentTimeMillis();
        System.out.println("Time: " + (time2-time1));

        if (sealedPdf.length < 255) {
            System.out.println("签章路径: " + new String(sealedPdf));
        } else if (StringUtil.checkResultDataValid(sealedPdf)) {
            String savePath = super.targetSources + UUID.randomUUID() + ".pdf";
            FileUtil.wirteDataToFile(savePath, sealedPdf);
            System.out.println("用例4：10个不同的关键字签章：" + savePath + "\'");
        } else {
            System.out.println("batchSealAutoPdfTest(Servlet) wrong " + new String(sealedPdf, "UTF-8"));
        }
        System.out.println(sealedPdf.length);
    }
}

